
 use "Brexit dilemmas_Conjoint" ,clear

 ******************************************************
****1. GENERAL CONJOINT ANALYSIS
***************************************************************

*Figure 1
logit choice i.brexitb i.rights i.circul i.eula i.trade i.busine i.programme  


coefplot ,  ylab(, labs(vsmall)) omitted baselevels  xline(0)  drop(_cons )  level(95)  msize(vsmall) xlabel(-.2(.2)1)  /// 
heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (small) )   ///
groups(1.brexitbill 3.circulation = "{bf:Zero-sum Dimensions}"  1.trade 5.programmes = "{bf:Cooperation Dimensions}" )
**********************************


*Figure 2
*BY COUNTRY
	
logit choice i.brexitb##i.country i.rights##i.country i.circul##i.country i.eula##i.country i.trade##i.country i.busine##i.country i.programm##i.country 
 margins, dydx(brexitb rights circul eul trade busin programm)  at(country=1) post
estimates store i1
 
logit choice i.brexitb##i.country i.rights##i.country i.circul##i.country i.eula##i.country i.trade##i.country i.busine##i.country i.programm##i.country 
 margins, dydx(brexitb rights circul eul trade busin programm)  at(country=2) post
estimates store i2


 coefplot  (i1,  label(Germany) msymbol(d)   )  (i2, msymbol(s) label(Spain)   ) ,  ylab(, labs(vsmall)) omitted baselevels  xline(0)  ciopts(recast(rcap)) level(95)  xlabel(-.1(.1).3)  legend(pos(6) ring(0.1) row(1))  ///
heading (1.brexitbill  = "{bf:Brexit Bill}"    ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (small) ) ///
groups(1.brexitbill 3.circulation = "{bf:Zero-sum Dimensions}"  1.trade 5.programmes = "{bf:Cooperation Dimensions}" )
**********************************




*****************
*Figure 3
*************
***ACCOMMODATION DILEMA: CONJOINT BY ATTITUDES
****************
	


 logit choice i.brexitb##c.eu_opinion i.rights##c.eu_opinion i.circul##c.eu_opinion i.eulaw##c.eu_opinion i.trade##c.eu_opinion i.busine##c.eu_opinion i.programm##c.eu_opinion 
 margins, dydx(brexitb rights circul eul trade busin programm )  at(eu_opinion=1) post
 estimates store i1

 
  logit choice i.brexitb##c.eu_opinion i.rights##c.eu_opinion i.circul##c.eu_opinion i.eulaw##c.eu_opinion i.trade##c.eu_opinion i.busine##c.eu_opinion i.programm##c.eu_opinion 
 margins,dydx(brexitb rights circul eul trade busin programm )  at(eu_opinion=5) post
 estimates store i2

 
 coefplot (i1,  label(Strong EU supporter) msymbol(d)   )  (i2, msymbol(s) label(Strong Eurosceptic)   ),  ylab(, labs(vsmall))  omitted baselevels xline(0)  ciopts(recast(rcap)) ///
 legend(pos(6) ring(0.1) row(1)) ///
 level(95) xlabel(-.15(.10).35)  ///
 heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
 1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (vsmall) )   ///
groups(1.brexitbill 3.circulation = "{bf:Zero-sum Dimensions}"  1.trade 5.programmes = "{bf:Cooperation Dimensions}"  )




	


*****************************
* Figure 4
* BREXIT DEALS SIMULATIONS
***************************


  
logit choice i.brexitb i.rights i.circul i.eula i.trade i.busine i.programme 
margins, at (brexitb==4 rights==3  circul ==3 eula==3 trade==1 busine==1 programme==1)  level (95) saving(file1, replace)



logit choice i.brexitb i.rights i.circul i.eula i.trade i.busine i.programme  
margins, at (brexitb==1 rights==1  circul ==1 eula==1 trade==1 busine==1 programme==1)   level (95) saving(file2, replace)




logit choice i.brexitb i.rights i.circul i.eula i.trade i.busine i.programme  
margins, at (brexitb==1 rights==1  circul ==1 eula==1 trade==3 busine==3 programme==5)   level (95) saving(file3, replace)




logit choice i.brexitb i.rights i.circul i.eula i.trade i.busine i.programme   
margins, at (brexitb==4 rights==3  circul ==1 eula==1 trade==2 busine==3 programme==4)   level (95)  saving(file4, replace)




  
  combomarginsplot  file1 file2 file3 file4, ///
    labels( `" "{bf:Preferred EU}" " " "Brexit Bill: large" "Rights: not limited" "FoM: not restricted" "EU law: all areas" "Trade: no barriers" "Business: no limitations" "Programs: all+crime" "' ///
  `" "{bf:Preferred UK}" " " "Brexit Bill: none" "Rights: subst. limited" "FoM: subst. restr." "EU law: no areas" "Trade: no barriers" "Business: no limitations" "Programs: all+crime" "' ///
  `" "{bf:No deal}" " " "Brexit Bill: none" "Rights: subst. limited" "FoM: subst. restrict." "EU law: no areas" "Trade: high barriers" "Business: signif. limitations" "Programs: no" "' ///
  `" "{bf:Final Deal}" " " "Brexit Bill: large" "Rights: not limited" "FoM: subst. restrict." "EU law: no areas" "Trade: some barriers" "Business: signif. limitations" "Programs: some" "' ///  
	 ) title("")  xtitle ("") ytitle("Probability of acceptance of Brexit deal") yline(.5) recast(scatter) ylabel (0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1) xscale(range(0.5 4.5)) ///
	xlabel (, labsize (vsmall) )  
	

	
	************************************************
	************************************************
	****APPENDIX
	***************************************************
	************************************************
	
	
**************
***Appendix 3
******************
  
  


 logit choice i.brexitb##i.wave i.rights##i.wave i.circul##i.wave i.eula##i.wave i.trade##i.wave i.busine##i.wave i.programme##i.wave 
 margins, dydx(brexitb rights circul eul trade busin programm)  at(wave=1) post
estimates store i1

logit choice i.brexitb##i.wave i.rights##i.wave i.circul##i.wave i.eula##i.wave i.trade##i.wave i.busine##i.wave i.programme##i.wave 
 margins, dydx(brexitb rights circul eul trade busin programm)  at(wave=2) post
estimates store i2
 
coefplot (i1, msymbol(d) label(December 2017)  )  (i2, msymbol(s) label(March 2019)) ///
 , ylab(, labs(vsmall))  omitted baselevels  xline(0)  drop(_cons )  level(95)  msize(small) xlabel(-.1(.1).3)  legend(pos(6) ring(0.1) row(1)) ciopts(recast(rcap)) /// 
heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (small) labcolor(orange))  



*************** 
**Appendix 4
*************** 


logit choice i.brexitb##c.regionalexposure i.rights##c.regionalexposure i.circul##c.regionalexposure i.eula##c.regionalexposure i.trade##c.regionalexposure i.busine##c.regionalexposure i.programm##c.regionalexposure
 margins, dydx(brexitb rights circul eul trade busin programm)  at(regionalexposure=.6) post
estimates store i1
 
logit choice i.brexitb##c.regionalexposure i.rights##c.regionalexposure i.circul##c.regionalexposure i.eula##c.regionalexposure i.trade##c.regionalexposure i.busine##c.regionalexposure i.programm##c.regionalexposure
 margins, dydx(brexitb rights circul eul trade busin programm)  at(regionalexposure=5.75) post
estimates store i2

coefplot (i1, msymbol(d) label(Low regional exposure)  )  (i2, msymbol(s) label(High regional exposure)) ///
 , ylab(, labs(vsmall))  omitted baselevels  xline(0)  drop(_cons )  level(95)  msize(small) xlabel(-.1(.1).3) legend(pos(6) ring(0.1) row(1))  ciopts(recast(rcap)) /// 
heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (small) labcolor(orange)) 
	

*************** 	
***Appendix 5
*************** 	
  
logit choice i.brexitb##c.friends_uk i.rights##c.friends_uk i.circul##c.friends_uk i.eula##c.friends_uk i.trade##c.friends_uk i.busine##c.friends_uk i.programm##c.friends_uk  
 margins, dydx(brexitb rights circul eul trade busin programm)  at(friends_uk=1) post
estimates store i1
 
logit choice i.brexitb##c.friends_uk i.rights##c.friends_uk i.circul##c.friends_uk i.eula##c.friends_uk i.trade##c.friends_uk i.busine##c.friends_uk i.programm##c.friends_uk     
 margins, dydx(brexitb rights circul eul trade busin programm)  at(friends_uk=2) post
estimates store i2


 coefplot (i1,  label(Friends and relatives in UK) msymbol(d)   )  (i2, msymbol(s) label(No friends or relatives in UK)   ),  ylab(, labs(vsmall))  omitted baselevels xline(0)  ciopts(recast(rcap)) ///
 legend(pos(6) ring(0.1) row(1)) ///
 level(95) xlabel(-.15(.10).35)  ///
 heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
 1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (vsmall) labcolor(orange)) 


****************** 
*Appendix 6
*************** 

 *** EU referendum
 
 logit choice i.brexitb##c.eu_ref i.rights##c.eu_ref i.circul##c.eu_ref i.eulaw##c.eu_ref i.trade##c.eu_ref i.busine##c.eu_ref i.programm##c.eu_ref    
 margins, dydx(brexitb rights circul eulaw trade business programme )  at(eu_ref=1) post
 estimates store i1


 logit choice i.brexitb##c.eu_ref i.rights##c.eu_ref i.circul##c.eu_ref i.eulaw##c.eu_ref i.trade##c.eu_ref i.busine##c.eu_ref i.programm##c.eu_ref   
 margins, dydx(brexitb rights circul eulaw trade business programme )  at(eu_ref=4) post
 estimates store i2



 coefplot (i1,  label(EU remainer voter) msymbol(d)   )  (i2, msymbol(s) label(EU leaver voter)   ),  ylab(, labs(vsmall))  omitted baselevels xline(0)  ciopts(recast(rcap)) ///
 legend(pos(6) ring(0.1) row(1)) ///
 level(95) xlabel(-.15(.10).35)  ///
 heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
 1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (vsmall) labcolor(orange)) 



**************
***Appendix 7
******************
  
 * By satisfaction with government's Brexit negotiation handling 
logit choice i.brexitb##i.satis_brexitgov i.rights##i.satis_brexitgov i.circul##i.satis_brexitgov i.eula##i.satis_brexitgov i.trade##i.satis_brexitgov i.busine##i.satis_brexitgov i.programm##i.satis_brexitgov
 margins, dydx(brexitb rights circul eul trade busin programm)  at(satis_brexitgov=1) post
estimates store i1
 
logit choice i.brexitb##i.satis_brexitgov i.rights##i.satis_brexitgov i.circul##i.satis_brexitgov i.eula##i.satis_brexitgov i.trade##i.satis_brexitgov i.busine##i.satis_brexitgov i.programm##i.satis_brexitgov
 margins, dydx(brexitb rights circul eul trade busin programm)  at(satis_brexitgov=0) post
estimates store i2

 coefplot  (i1,  label(satisfied with government's Brexit negotiation handling ) msymbol(d)   )  (i2, msymbol(s) label(dissatisfied with government's Brexit negotiation handling )   ) ,  ylab(, labs(vsmall)) omitted baselevels  xline(0)  ciopts(recast(rcap)) level(95)  xlabel(-.1(.1).3)  legend (position(6)) ///
heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation in Programs}"   ///
, labsize (small) labcolor(orange)) 


*By support for the government
logit choice i.brexitb##i.vote_incumbent i.rights##i.vote_incumbent i.circul##i.vote_incumbent i.eula##i.vote_incumbent i.trade##i.vote_incumbent i.busine##i.vote_incumbent i.programm##i.vote_incumbent
 margins, dydx(brexitb rights circul eul trade busin programm)  at(vote_incumbent=1) post
estimates store i1
 
logit choice i.brexitb##i.vote_incumbent i.rights##i.vote_incumbent i.circul##i.vote_incumbent i.eula##i.vote_incumbent i.trade##i.vote_incumbent i.busine##i.vote_incumbent i.programm##i.vote_incumbent
 margins, dydx(brexitb rights circul eul trade busin programm)  at(vote_incumbent=0) post
estimates store i2


coefplot  (i1,  label(government supporter) msymbol(d)   )  (i2, msymbol(s) label(did not vote for governing party)   ) ,  ylab(, labs(vsmall)) omitted baselevels  xline(0)  ciopts(recast(rcap)) level(95)  xlabel(-.1(.1).3)  legend (position(6)) ///
heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation Programs}"   ///
, labsize (small) labcolor(orange)) 




*By education
logit choice i.brexitb##i.loweducation i.rights##i.loweducation i.circul##i.loweducation i.eula##i.loweducation i.trade##i.loweducation i.busine##i.loweducation i.programm##i.loweducation
 margins, dydx(brexitb rights circul eul trade busin programm)  at(loweducation=1) post
estimates store i1
 
logit choice i.brexitb##i.mediumeducation i.rights##i.mediumeducation i.circul##i.mediumeducation i.eula##i.mediumeducation i.trade##i.mediumeducation i.busine##i.mediumeducation i.programm##i.mediumeducation
 margins, dydx(brexitb rights circul eul trade busin programm)  at(mediumeducation=1) post
estimates store i2

logit choice i.brexitb##i.higheducation i.rights##i.higheducation i.circul##i.higheducation i.eula##i.higheducation i.trade##i.higheducation i.busine##i.higheducation i.programm##i.higheducation
 margins, dydx(brexitb rights circul eul trade busin programm)  at(higheducation=1) post
estimates store i3



 coefplot  (i1,  label(low education) msymbol(d)   )  (i2, msymbol(s) label(medium education)   )  (i3,  label(high education) msymbol(c)   ),  ylab(, labs(vsmall)) omitted baselevels  xline(0)  ciopts(recast(rcap)) ///
 level(95)  xlabel(-.1(.1).3)   legend(pos(6) ring(0.1) row(1)) ///
heading (1.brexitbill  = "{bf:Brexit Bill}"  ///
1.rights  = "{bf:Rights EU citizens}"   ///
1.circulation = "{bf:Freedom of Movement}"   ///
1.eulaw  = "{bf: Applicability EU Law}"   ///
1.trade  = "{bf: Trade }" ///
1.business  = "{bf: Freedom business }"  ///
1.programmes = "{bf:Participation Programs}"   ///
, labsize (small) labcolor(orange)) 
